package com.qunduikj.sjb.sdk.model.enums;

import com.qunduikj.sjb.R;

/**
 * @author Jovita
 * @date 2015-08-21
 */
public enum GradeType {
    PrimaryChild(1, R.drawable.grade_primary_child), MiddleChild(2, R.drawable.grade_middle_child),
    HighChild(3, R.drawable.grade_high_child),
    PrimaryGuard(4, R.drawable.grade_primary_guard), MiddleGuard(5, R.drawable.grade_middle_guard),
    HighGuard(6, R.drawable.grade_high_guard),
    PrimaryDart(7, R.drawable.grade_primary_dart), MiddleDart(8, R.drawable.grade_middle_dart),
    HighDart(9, R.drawable.grade_high_dart),
    PrimaryDeputy(10, R.drawable.grade_primary_deputy), MiddleDeputy(11, R.drawable.grade_middle_deputy),
    HighDeputy(12, R.drawable.grade_high_deputy),
    PrimaryTotal(13, R.drawable.grade_primary_total), MiddleTotal(14, R.drawable.grade_middle_total),
    HighTotal(15, R.drawable.grade_high_total),
    PrimaryKing(16, R.drawable.grade_primary_king);

    private long gradeID;
    private int picRes;

    GradeType(int gradeID, int picRes) {
        this.gradeID = gradeID;
        this.picRes = picRes;
    }

    public long getgradeID() {
        return gradeID;
    }

    public void setgradeID(int gradeID) {
        this.gradeID = gradeID;
    }

    public int getPic() {
        return picRes;
    }

    public void setPic(int picRes) {
        this.picRes = picRes;
    }


    public static int valueOfGrade(long exID) {
        GradeType gradeTypes[] = GradeType.values();
        for (int i = 0; i < gradeTypes.length; i++) {
            GradeType ct = gradeTypes[i];
            if (ct.getgradeID() == exID) {
                return ct.getPic();
            }
        }
        return R.drawable.grade_primary_child;
    }
}
